package catering

import (
	"gitee.com/g-qs/gin-vue-admin/server/api/v1"
	"gitee.com/g-qs/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type FoodRouter struct {
}

// InitFoodRouter 初始化 配餐 路由信息
func (s *FoodRouter) InitFoodRouter(Router *gin.RouterGroup) {
	foodRouter := Router.Group("food").Use(middleware.OperationRecord())
	foodRouterWithoutRecord := Router.Group("food")
	var foodApi = v1.ApiGroupApp.CateringApiGroup.FoodApi
	{
		foodRouter.POST("createFood", foodApi.CreateFood)             // 新建配餐
		foodRouter.DELETE("deleteFood", foodApi.DeleteFood)           // 删除配餐
		foodRouter.DELETE("deleteFoodByIds", foodApi.DeleteFoodByIds) // 批量删除配餐
		foodRouter.PUT("updateFood", foodApi.UpdateFood)              // 更新配餐
	}
	{
		foodRouterWithoutRecord.GET("findFood", foodApi.FindFood)               // 根据ID获取配餐
		foodRouterWithoutRecord.GET("getFoodList", foodApi.GetFoodList)         // 获取配餐列表
		foodRouterWithoutRecord.GET("getLastPlanList", foodApi.GetLastPlanList) // 获取最近方案列表
	}
}
